package com.ruoyi.client.pojo.form;

import com.fasterxml.jackson.annotation.JsonAlias;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 保存订单param
 */
@Data
@ApiModel(description = "保存订单参数")
public class OrderInsertForm {

    @ApiModelProperty(value = "地址id", position = 1, required = true)
    @NotNull(message = "addressId不能为空")
    @JsonAlias({"address_id", "addressId"})
    private Long addressId;

    @ApiModelProperty(value = "备注", position = 2)
    private String remark;

    @ApiModelProperty(value = "订单项列表", position = 3, required = true)
    @NotEmpty(message = "订单项列表不能为空")
    @JsonAlias({"goods_list", "goodsList", "orderItemList", "order_item_list"})
    private List<OrderItemInsertForm> orderItemList;
}